package fr.umlv.m2.jee.pmlv.service.user;

import java.util.List;
import javax.naming.NamingException;

import org.springframework.dao.DataAccessException;

/**
 * Interface of the methods for interaction with the LDAP.
 * @author Karim HAROUNI
 */
public interface IUserService {

    /**
     * method to get informations about all users stocked in ldap
     * @return List<User>
     * @throws DataAccessException
     */
    public List<User> getAllUsers()throws NamingException;

    /**
     * method to get details of a user
     * @param commonName
     * @param lastName
     * @return User
     * @throws DataAccessException
     */
    public User getUserDetails(String commonName, String lastName)throws NamingException;

    /**
    * method to get group of a user
    * @param commonName
    * @return group where user belongs
    * @throws NamingException
    */
    public String getUserGroups(String commonName) throws NamingException;

    /**
    * method to get student who follow this subject
    * @param id
    * @return students
    * @throws NamingException
    */
    public List<User> getStudentBySubjectIdAndByYear(Long id, int year) throws NamingException;

    /**
     * method to get years when professor teach a subject
     * @param uid
     * @return
     * @throws NamingException
     */
    public List<Integer> getYearsByProfessorId(String uid) throws NamingException;

    /**
     * method to get years when student is in university
     * @param uid
     * @return
     * @throws NamingException
     */
    public List<Integer> getYearsByStudentId(String uid) throws NamingException;

    /**
     * method to get reponsible of subject for a year
     * @param uid
     * @return
     * @throws NamingException
     */
    public List<User> getResponsibleBySubjectAndByYear(long sub_id, int year) throws NamingException;
}
